<template>
    <div class="module-wrap">
      <div class="tool-row">
        <el-button size="small" type="primary" @click="addRow">新增记录</el-button>
        <el-button size="small" @click="$emit('refresh')">刷新</el-button>
      </div>
  
      <el-table :data="rows" border stripe height="520">
        <el-table-column prop="type" label="数据类型" width="120"/>
        <el-table-column prop="value" label="数据值" />
        <el-table-column prop="time" label="时间" width="180"/>
        <el-table-column label="操作" width="120">
          <template #default="{row}">
            <el-button link size="small" type="primary" @click="editRow(row)">编辑</el-button>
            <el-button link size="small" type="danger"  @click="delRow(row)">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </template>
  
  <script setup>
  import {ref} from 'vue';
  const props = defineProps({ mother:Object });
  const rows = ref([]); // 后端拉：FAT/调试/运行/待用时间/运行数据...
  function addRow(){ /* 打开新增对话框 */ }
  function editRow(r){ /* 打开编辑对话框 */ }
  function delRow(r){ /* 调删除接口并刷新 */ }
  </script>
  
  <style scoped>
  .module-wrap{ display:grid; gap:12px; }
  .tool-row{ display:flex; gap:8px; }
  </style>
  